package cn.edu.tju.cas.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Created by catold on 16/3/12.
 */
@Entity
@Table(name = "GROUP_FORM", schema = "dev_cas", catalog = "")
public class GroupFormEntity implements Serializable {
    private int groupFormId;
    private Integer groupId;
    private Integer type;
    private String label;
    private String valueTemplate;
    private Timestamp createtime;
    private Timestamp updatetime;

    @Id
    @GeneratedValue
    @Column(name = "GROUP_FORM_ID", nullable = false)
    public int getGroupFormId() {
        return groupFormId;
    }

    public void setGroupFormId(int groupFormId) {
        this.groupFormId = groupFormId;
    }

    @Basic
    @Column(name = "GROUP_ID", nullable = true)
    public Integer getGroupId() {
        return groupId;
    }

    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }

    @Basic
    @Column(name = "TYPE", nullable = true)
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Basic
    @Column(name = "LABEL", nullable = true, length = 255)
    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    @Basic
    @Column(name = "VALUE_TEMPLATE", nullable = true, length = 255)
    public String getValueTemplate() {
        return valueTemplate;
    }

    public void setValueTemplate(String valueTemplate) {
        this.valueTemplate = valueTemplate;
    }

    @Basic
    @Column(name = "CREATETIME", nullable = true)
    public Timestamp getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Timestamp createtime) {
        this.createtime = createtime;
    }

    @Basic
    @Column(name = "UPDATETIME", nullable = true)
    public Timestamp getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Timestamp updatetime) {
        this.updatetime = updatetime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GroupFormEntity that = (GroupFormEntity) o;

        if (groupFormId != that.groupFormId) return false;
        if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;
        if (label != null ? !label.equals(that.label) : that.label != null) return false;
        if (valueTemplate != null ? !valueTemplate.equals(that.valueTemplate) : that.valueTemplate != null)
            return false;
        if (createtime != null ? !createtime.equals(that.createtime) : that.createtime != null) return false;
        if (updatetime != null ? !updatetime.equals(that.updatetime) : that.updatetime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = groupFormId;
        result = 31 * result + (groupId != null ? groupId.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (label != null ? label.hashCode() : 0);
        result = 31 * result + (valueTemplate != null ? valueTemplate.hashCode() : 0);
        result = 31 * result + (createtime != null ? createtime.hashCode() : 0);
        result = 31 * result + (updatetime != null ? updatetime.hashCode() : 0);
        return result;
    }
}
